import 'package:flutter/material.dart';
import 'package:flutter_widget/src/config/color_define.dart';

/*加载圈圈*/
class LoadingWidget extends StatelessWidget {
  final Color? backgroundColor;
  final Color? circleColor;
  final Widget? child;

  const LoadingWidget({
    Key? key,
    this.backgroundColor,
    this.circleColor,
    this.child,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return IgnorePointer(
      child: Container(
        color: backgroundColor,
        child: Center(
          child: child ?? SizedBox(
            width: 32,
            height: 32,
            child: CircularProgressIndicator(
              strokeWidth: 3,
              valueColor: AlwaysStoppedAnimation<Color>(
                circleColor ?? FWColorPicker.colorFFDAB27E,
              ),
            ),
          ),
        ),
      ),
    );
  }
}